<div class="issue-detail">
  <div class="source_title">
    <%
      project = @issue_results.project(@issue)
      component = @issue_results.component(@issue)
    %>

    <% if project && @issue.componentKey() != project.key() %>
    <div class="subtitle">
      <%= h project.longName() -%>
    </div>
    <% end %>
    <span class="h1">
      <% if component %>
      <%= qualifier_icon(component) %>
      <a href="<%= ApplicationController.root_context -%>/component/index#component=<%= component.key() -%>&tab=issues" class="issue-component-link"
         onclick="window.open(this.href,'resource-<%= component.key().parameterize -%>','height=800,width=900,scrollbars=1,resizable=1');return false;"><%= h component.longName() -%></a>
      <% else %>
        <%= h @issue.componentKey() %> [<del><%= message('issue.component_deleted') %></del>]
      <% end %>
    </span>
  </div>

  <div class="marginbottom10">
  <%= render :partial => 'issue/issue', :locals => {:issue => @issue_results.first} -%>
  </div>

  <!-- SONAR-4686 Do not display source code if user has not the "Code Viewer" permission -->
  <% if @snapshot && @issue.line && params[:source]!='false' && has_role?(:codeviewer, @snapshot.project) %>
    <div class="bordered">
      <%= snapshot_html_source(@snapshot, {:line_range => (@issue.line-5)..(@issue.line+5), :highlighted_lines => [@issue.line]}) -%>
    </div>
  <% else %>
    <!--
      SONAR-4438 If no source code, add blank lines in order for the "more action" link to be well displayed
    -->
    <div style="height: 60px;"></div>
  <% end %>
</div>
